import axios from "axios";

const request = axios.create({
  widthCredentials: true,
  timeout: 30000,
});
request.interceptors.request.use((req) => {
  return req;
});

request.interceptors.response.use(
  (res) => {
    return res.data;
  },
  (error) => {
    return {
      flag: false,
      data: error,
    };
  }
);

export default request;
